import { ElMessage,ElMessageBox } from 'element-plus'

//确认弹窗
export const confirmBox = (msg,rcb,type='warning') =>{
    ElMessageBox.confirm(
        msg,
        type,
        {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: type,
        }
      )
        .then(() => {
          rcb()
        })
        .catch(() => {
          ElMessage({
            type: 'info',
            message: '已取消',
          })
      })
};

// 普通弹窗
export const msgBox = (message,type='success') => {
  ElMessage({type,message})
}
  